package com.cade.agriculturemall.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.cade.agriculturemall.R;

/**
 * Created by Lobby on 2017/11/28.
 */

public class DoubleListLayout extends LinearLayout {

    private TextView tvFirst;
    private TextView tvTwice;

    public DoubleListLayout(Context context) {
        super(context);
        setup();
    }

    public DoubleListLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        setup();
    }


    private void setup() {
        LayoutInflater.from(getContext()).inflate(R.layout.layout_double_text_view, this, true);
        tvFirst = (TextView) findViewById(R.id.text1);
        tvTwice = (TextView) findViewById(R.id.text2);
    }

    public void setText(String first, String twice) {
        tvFirst.setText(first);
        tvTwice.setText(twice);
    }

    //点击事件
    public interface IMyClick {
        public void onMyClick(String str);
    }

    /*初始化接口变量*/
    IMyClick iMyClick = null;

    /*自定义事件*/
    public void setOnMyClickListener(IMyClick _iMyClick) {
        iMyClick = _iMyClick;
    }


}
